// pages/home/friend/index.js
import {
  getMakingFrienfApi
} from '../../../https/user'
import {
  BASE_URL
} from '../../../constant/index'
Page({

  /**
   * 页面的初始数据
   */
  data: {
    BASE_URL,
    makingFriendList: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.getMakingFriend()
  },
  async getMakingFriend() {
    console.log(1)
    const getRes = await getMakingFrienfApi()
    console.log(getRes)
    if (getRes.code == 200) {
      this.setData({
        makingFriendList: getRes.data
      })
    }
  },
  async gotoMyDetail(e) {
    const docid = e.currentTarget.dataset.docid
    console.log(docid)
    wx.navigateTo({
      url: '../../my/detail/index?docid=' + docid,
    })
  },
  async gotoChat(e) {
    const docid = e.currentTarget.dataset.docid

    wx.navigateTo({
      url: '../../message/chat/index?docid=' + docid,
    })
  }

})